package com.example.Prototype;

/**
 * Prototype 原型模式
 * https://www.runoob.com/design-pattern/prototype-pattern.html
 */
public class app {
    public static void main(String[] args) {
        ShapeCache.loadCache();

        Shape shape = ShapeCache.getShape("1");
        System.out.println(shape.getType());

        shape = ShapeCache.getShape("2");
        System.out.println(shape.getType());

        shape = ShapeCache.getShape("3");
        System.out.println(shape.getType());

        // output:
        //     Circle
        //     Rectangle
        //     Square
    }
}
